package com.ray.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ray.bean.MaterialTypeExceptSourceBean;
import com.ray.service.MaterialTypeExceptSourceService;
import com.ray.util.RequestUtil;
import com.ray.util.ResponseUtil;

@RestController
@RequestMapping("materialTypeExceptSource")
public class MaterialTypeExceptSourceController {
	@Autowired
	MaterialTypeExceptSourceService materialTypeExceptSourceService;
	//获取列表
	@RequestMapping("/getList")
	public Map getList(HttpServletRequest request,MaterialTypeExceptSourceBean bean)  { 
		Map map=RequestUtil.getRequestAllParam(request);
		bean.setCompany(map.get("loginCompany").toString());
		return ResponseUtil.ResponseResult(materialTypeExceptSourceService.getList(bean));
	}
	//增加物料
	@RequestMapping("/insertMaterialType")
	public Map insertMaterialType(HttpServletRequest request,MaterialTypeExceptSourceBean bean)  {  
		Map map=RequestUtil.getRequestAllParam(request);
		bean.setCompany(map.get("loginCompany").toString());
		return ResponseUtil.ResponseResult(materialTypeExceptSourceService.insertMaterialType(bean));
	}
	//更新物料
	@RequestMapping("/updateMaterialType")
	public Map updateMaterialType(HttpServletRequest request,MaterialTypeExceptSourceBean bean)  {  
		return ResponseUtil.ResponseResult(materialTypeExceptSourceService.updateMaterialType(bean));
	}
}
